package com.it;

import com.it.dao.BookDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Author yuan
 * @Date 2023/9/18
 * @ApiNote
 */
public class AppForScope {
    public static void main(String[] args) {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
        BookDao bookDao1 = (BookDao) ctx.getBean("BookDao");
        BookDao bookDao2 = (BookDao) ctx.getBean("BookDao");
        System.out.println(bookDao1);
        // => com.it.dao.impl.BookDaoImpl@2e1d27ba
        System.out.println(bookDao2);
        // => com.it.dao.impl.BookDaoImpl@61d6015a
    }
}
